﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ManejoExcepciones.aspx.cs" Inherits="TCU.ManejoExcepciones" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script>

        $(document).ready(function () {
            dateToday = new Date(); 
            $(".datepick").datetimepicker({ dateFormat: "mm/dd/yy", minDate: dateToday });
        });
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<asp:Label ID="excepcionNotification" runat="server" Text="" ForeColor="Red"></asp:Label>
<h1>Manejo de Excepciones</h1>
<hr />

<asp:GridView ID="gvExcepciones" runat="server" AutoGenerateColumns="False" 
        AutoGenerateDeleteButton="True" CssClass="table" 
        GridLines="None" ShowFooter="True" onrowcommand="gvExcepciones_RowCommand" 
        onrowdeleting="gvExcepciones_RowDeleting">
    <Columns>
        <asp:TemplateField HeaderText="ID" SortExpression="ExcepcionID">
            <EditItemTemplate>
            </EditItemTemplate>
            <ItemTemplate>
                <asp:Label ID="lblIDExcepcion" runat="server" Text='<%# Bind("ExcepcionID") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Comiezo" SortExpression="Comiezo">
            <EditItemTemplate>
                <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Comienzo") %>'></asp:TextBox>
            </EditItemTemplate>
            <FooterTemplate>
                <asp:TextBox ID="txtComiezoExcepcion" CssClass="datepick" runat="server"></asp:TextBox>
            </FooterTemplate>
            <ItemTemplate>
                <asp:Label ID="lbID" runat="server" Text='<%# Bind("Comienzo") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Fin" SortExpression="HoraTiempo">
            <EditItemTemplate>
                <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("HoraTiempo") %>'></asp:TextBox>
            </EditItemTemplate>
            <FooterTemplate>
                <asp:TextBox ID="txtFinExcepcion" CssClass="datepick" runat="server"></asp:TextBox>
            </FooterTemplate>
            <ItemTemplate>
                <asp:Label ID="Label2" runat="server" Text='<%# Bind("HoraTiempo") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Informatico" SortExpression="Informatico">
            <EditItemTemplate>
                <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Informatico") %>'></asp:TextBox>
            </EditItemTemplate>
            <FooterTemplate>
                <asp:DropDownList ID="dropInformaticoExcepcion" runat="server" 
                    DataSourceID="SqlDataSource1" DataTextField="NombreCompleto" 
                    DataValueField="InformaticoID">
                </asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:SSTConnectionString %>" 
                    SelectCommand="SELECT [NombreCompleto], i.InformaticoID

FROM [Informatico]  as i 
INNER JOIN RolInformatico as ri ON i.InformaticoID=ri.InformaticoID
INNER JOIN Rol as r ON r.RolID=ri.RolID

WHERE (i.[FechaBorrado] IS NULL)
AND r.NombreRol = 'Personal de Soporte'">
                </asp:SqlDataSource>
                <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Agregar">Agregar Excecpcion</asp:LinkButton>
            </FooterTemplate>
            <ItemTemplate>
                <asp:Label ID="Label3" runat="server" Text='<%# Bind("Informatico") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>

</asp:GridView>




</asp:Content>

